﻿using System;
using ProdControls.NativePatterns.MessageConstants;
using ProdControls.Utility;

namespace ProdControls
{
    /// <summary>
    ///   Methods to work with Button controls using the UI Automation framework
    /// </summary>
    internal static class ProdButtonNative
    {
        /// <summary>
        ///   Uses SendMessage to click the button
        /// </summary>
        /// <param name="windowHandle"> Handle to the button to send message to </param>
        internal static void Click(IntPtr windowHandle)
        {
            NativeMethods.SendMessage(windowHandle, (int) ButtonMessages.BM_CLICK, 0, 0);
        }
    }
}